package com.ktwlsoft.fundmanage.fundFlow.processHandler.FundOutServiceTask;

import com.ktwlsoft.fundmanage.fundFlow.processHandler.BaseServiceTask;
import com.ktwlsoft.fundmanage.payload.fundOut.FundOutOrCancelRequest;
import org.activiti.engine.delegate.DelegateExecution;
import org.springframework.stereotype.Service;

@Service
public class GenerateFundOut extends BaseServiceTask {

    @Override
    public void execute(DelegateExecution execution) {
        FundOutOrCancelRequest fundOutOrCancelRequest = (FundOutOrCancelRequest) execution.getVariable("fundOutOrCancelRequest");
        fundOutService.generateFundOut(fundOutOrCancelRequest.getTransferId(),
                fundOutOrCancelRequest.getInstanceId(),
                fundOutOrCancelRequest.getTransferType(),
                false,
                fundOutOrCancelRequest.getCreatedAt(), fundOutOrCancelRequest.getRemark(), fundOutOrCancelRequest.getBankFlowCode(), fundOutOrCancelRequest.getType());
    }
}
